<?php
require_once('Xml/Abstract.php');

class Xml_Sitemap extends Xml_Abstract {
    protected function _header($_aryData) {
        return <<<Sitemap
            <urlset>
Sitemap;
    }

    protected function _footer($_aryData) {
        return <<<Sitemap
            </urlset>
Sitemap;
    }

    protected function _items($_aryData) {
        $_content = '';
        foreach($_aryData as $_data) {
            $_content .= <<<Sitemap
                <url>
                    <loc>{$_data['loc']}</loc>
                    <lastmod>{$_data['lastmod']}</lastmod>
                    <changefreq>{$_data['freq']}</changefreq>
                </url>
Sitemap;
        }
        return $_content;
    }

    /**
     * @see Xml_Abstract::getFileName()
     */
    public function getFileName() {
        return 'sitemapb.xml';
    }
}
